<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function getType(value) {
            return Object.prototype.toString.call(value).slice(8, -1).toLowerCase();
        }
        function isValidDate(date) {
            return date instanceof Date && !isNaN(date.getTime());
        }
        console.log(isValidDate(new Date()))
        console.log(isValidDate(new Date('')));
        console.log(isValidDate(''));
    </script>

</body>

</html>